//
//  NSObject+Tool.h
//  OralRobot
//
//  Created by 王桂敏 on 16/3/23.
//  Copyright © 2016年 huayingdai. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "UIImage+ReSize.h"

#include <ImageIO/ImageIOBase.h>

#include <ImageIO/CGImageSource.h>

#include <ImageIO/CGImageDestination.h>

#include <ImageIO/CGImageProperties.h>

#include <ImageIO/CGImageMetadata.h>

#import <sys/utsname.h>

@interface NSObject (Tool)

- (UIViewController *)appRootViewController;

- (ThirdBoundType)thirdShow;

//  获取indexTitles
- (NSArray *)getIndexArray;

//  排序
- (NSMutableArray *)sortDataArray:(NSArray *)dataArray
                              key:(NSString *)key;

//  给添加过圆角的view添加阴影
- (CALayer *)addShadowWithView:(UIView *)view
                shadowColor:(UIColor *)shadowColor
               shadowOffset:(CGSize)shadowOffset
              shadowOpacity:(CGFloat)shadowOpacity;




//  随机生成字符串
- (NSString *)retbitStringWithNum:(int)num;

//  生成随机数
- (int)getRandomNumber:(int)from to:(int)to;

//  当前时间转换成时间戳
- (NSString *)dateToStringWithFormatter:(NSString *)formatterStr;
//  时间转换成时间戳
- (NSString *)dateToStringWithDate:(NSDate *)date;
//  时间戳转换成时间
- (NSDate *)stringToDateWithTimeStr:(NSString *)timeStr;
//  加密
- (NSString *)encrypt3DES:(NSString *)src key:(NSString *)key;
- (NSString *)decrypt3DES:(NSString *)src key:(NSString *)key;

//二进制转化为十六进制
- (NSString *)NSDataToHexString:(NSData *)data;
//十六进制字符串转化为二进制
- (NSData *)hexStrToNSData:(NSString *)hexStr;

//  字符串数组排序（升序）
- (NSString *)sortWithDic:(NSMutableDictionary *)dic;

- (NSString *)intTohhmmss:(int)secCount;//  秒数转为时分秒

//  判断时间是否过期：未过期为Yes
- (BOOL)isEarlieryNowDateWithTimeStr:(NSString *)timeStr;

//  当前设备的类型
- (UIUserInterfaceIdiom)deviceIdiom;

//压缩图片
- (UIImage *)thumbnailForAsset:(ALAsset *)asset maxPixelSize:(NSUInteger)size;

- (NSMutableArray *)sortPhotoWithArray:(NSMutableArray *)array;

- (NSString *)iphoneType;

- (void)score;

- (NSArray *)rangeOfSubString:(NSString *)subStr inString:(NSString *)string;

//判断NSString字符串是否包含emoji表情
- (BOOL)stringContainsEmoji:(NSString *)string;

//禁止输入表情
- (NSString *)disable_emoji:(NSString *)text;
@end
